
/**判断是否是浏览器 */
export const isBrowser = ()=>typeof window !== 'undefined' && typeof document !== 'undefined';

/**相比于 isNode，不会检查 process.versions.node */
export const isServer = ()=> typeof process !== 'undefined' && process.versions != null;

/**判断是否是 NodeJS */
export const isNode = () => isServer() && process.versions.node != null;

/**判断是否是 election */
export const isElectron = () => isServer() && process.versions.electron != null;

/**同时满足 浏览器 和 NodeJS 运行环境，如 electron */
export const isBrowserAndNode = () => isBrowser() && isNode();

export const isNotBrowser = ()=> typeof window === 'undefined';
export const isNotServer = ()=> !isServer();